#include "AboutScene.h"
using namespace cocos2d;

bool AboutScene::init()
{
	bool ret = false;
	do 
	{
		CC_BREAK_IF(!CCScene::init());
		rootLayer = CCLayer::create();
		this->addChild(rootLayer);

		CCMenuItemImage * backMenuItem = CCMenuItemImage::create("btn-back.png",NULL,NULL,this,menu_selector(AboutScene::menuCallbackGoBack));

		CCMenu* menu = CCMenu::create( backMenuItem, NULL);
		menu->alignItemsVertically();
		rootLayer->addChild(menu);
		menu->setContentSize(backMenuItem->getContentSize());
		CCSize  menuSize =  backMenuItem->getContentSize();
		CCSize winSize = CCDirector::sharedDirector()->getWinSize();
		menu->setPosition(ccp(winSize.width - menuSize.width,menuSize.height / 2));
		ret = true;
	} while (false);
	return ret;
}

cocos2d::CCScene * AboutScene::scene()
{
	return AboutScene::create();
}

void AboutScene::menuCallbackGoBack( cocos2d::CCObject * pSender )
{
	CCDirector::sharedDirector()->popScene();
}
